//
//  DYIssueCardsVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/21.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYIssueCardsVC.h"
#import "DYSetCollectionCell.h"
#import "DYAddBranchShopCell.h"
#import "DYIssueCardsFooterView.h"
#import "DYIssueCardsAgreementVC.h"

@interface DYIssueCardsVC ()

@property (nonatomic,strong)NSArray *titleArray;
@property (nonatomic,strong)NSArray *placeholerArray;

@property (nonatomic,strong)DYIssueCardsFooterView *footerView;

@end

@implementation DYIssueCardsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title=@"发卡设置";
}
-(void)dy_initData
{
    [super dy_initData];
    
    self.titleArray=@[@"商铺营业执照",@"法人身份证正面",@"法人身份证反面",@"门头照片",@"收银台照片",@"店铺内景",@"售后电话（平台将通过此电话进行人工审核）",@"手机号",@"验证码"];
    self.placeholerArray=@[@"上传商铺营业执照",@"上传法人身份证正面",@"上传法人身份证反面",@"含门店名称牌匾、门牌号码",@"含收银员、收银机或收银二维码",@"上传店铺内景",@"请输入售后电话",@"请输入手机号",@"请输入验证码"];
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    
    self.tableView.backgroundColor=WhiteColor;
    
    [self.tableView registerClass:[DYSetCollectionCell class] forCellReuseIdentifier:@"DYSetCollectionCell"];
    [self.tableView registerClass:[DYSetCollectionCodeCell class] forCellReuseIdentifier:@"DYSetCollectionCodeCell"];
    [self.tableView registerClass:[DYAddBranchShopCell class] forCellReuseIdentifier:@"DYAddBranchShopCell"];
    self.tableView.tableFooterView=self.footerView;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 9;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==8||indexPath.row==6||indexPath.row==7) {
        return BILIHEIGHT(58);
    }
    return BILIHEIGHT(104);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==8) {
        DYSetCollectionCodeCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYSetCollectionCodeCell" forIndexPath:indexPath];
        return cell;
    }else if (indexPath.row==6||indexPath.row==7){
        DYAddBranchShopCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYAddBranchShopCell" forIndexPath:indexPath];
        cell.titleLabel.text=self.titleArray[indexPath.row];
        cell.textField.placeholder=self.placeholerArray[indexPath.row];
        [cell.textField setNumbersKeyboard];
        
        return cell;
    }
    DYSetCollectionCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYSetCollectionCell" forIndexPath:indexPath];
    cell.titleLabel.text=self.titleArray[indexPath.row];
    cell.tipLabel.text=self.placeholerArray[indexPath.row];
    return cell;
}
-(DYIssueCardsFooterView *)footerView
{
    if (!_footerView) {
        _footerView=[[DYIssueCardsFooterView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, BILIHEIGHT(175))];
        
        @weakify(self);
        _footerView.submitBlock = ^{
            
        };
        
        _footerView.agreementBlock = ^{
            @strongify(self);
            DYIssueCardsAgreementVC *vc=[[DYIssueCardsAgreementVC alloc]init];
            [self.navigationController pushViewController:vc animated:YES];
        };
    }
    return _footerView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
